<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:insert="~{include :: header('用户(前台用户)列表')}" />
    <th:block th:insert="~{include :: bootstrap-table-css}" />
</head>
<body class="hold-transition">
<div class="container-fluid mb-2">
    <table id="bootstrap-table" class="table-striped"></table>
</div>
<th:block th:insert="~{include :: footer}" />
<th:block th:insert="~{include :: bootstrap-table-js}" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('user:edit')}]];
    var removeFlag = [[${@permission.hasPermi('user:remove')}]];
    var isAvailableDatas = [[${@dict.getType('qdx_user_state')}]];
    var registerFromDatas = [[${@dict.getType('qdx_user_register')}]];
    var prefix = "/course/user";

    $(function() {
        var options = {
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            queryParams: queryParams,
            url: prefix + "/list.json",
            modalName: "用户",
            columns: [
                {
                    field: 'userId',
                    title: 'id',
                },
                {
                    field: 'userName',
                    title: '用户名'
                },
                {
                    field: 'mobile',
                    title: '手机号'
                },
                {
                    field: 'registerFrom',
                    title: '注册来源',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(registerFromDatas, value);
                    }
                },
                {
                    field: 'isAvailable',
                    title: '状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(isAvailableDatas, value);
                    }
                },
                {
                    field: 'createTime',
                    title: '注册时间'
                }]
        };
        $.table.init(options);
    });

    function queryParams(params) {
        var search = $.table.queryParams(params);
        search.courseId = [[${courseId}]];
        return search;
    }
</script>
</body>
</html>